Class Sample

Summary

Fully Qualified Name: Laminas\Log\Filter\Sample
Implements: FilterInterface

Description

Methods

Name Description Defined By
__construct() Filters logging by sample rate. Sample
filter() Returns TRUE to accept the message, FALSE to block it. Sample

Method Details

__construct()

Filters logging by sample rate.

Sample rate must be a float number between 0 and 1 included. If 0.5, only half of the values will be logged. If 0.1 only 1 among 10 values will be logged.

Parameter Name Type Description
$sampleRate float|int Sample

Returns: \Priority

filter()

Returns TRUE to accept the message, FALSE to block it.

Parameter Name Type Description
$event array event

Returns: bool Accepted ?

Top